+ UpdateImmortality(gameTime);
+ }
+
+ public void UpdateImmortality(GameTime gameTime)
+ {
+ if (Immortal)
+ {
+ CurrentImmortalTime += gameTime.ElapsedGameTime.Milliseconds;
+
+ if (Flashing)
+ {
+ Color = new Color(255, 255, 255, 128);
+ }
+ else
+ {
+ Color = Color.White;
+ }
+
+ Flashing = !Flashing;
+
+ if (CurrentImmortalTime > MaxImmortalTime)
+ {
+ Immortal = false;
+ Color = Color.White;
+ }
+ }
+ }
+
+ public override void Move(GameTime gameTime)
+ {
+ var VelocityLimit = MaxVelocity;
+ var SavedVelocity = new Vector2(Velocity.X, Velocity.Y);
+
+ if (Shooting)
+ {
+ VelocityLimit = ActVelocity;
+ }
+
+ if (SavedVelocity.X > VelocityLimit)
+ {
+ SavedVelocity.X = VelocityLimit;
+ }
+
+ if (SavedVelocity.X < -VelocityLimit)
+ {
+ SavedVelocity.X = -VelocityLimit;
+ }
+
+ if (SavedVelocity.Y > VelocityLimit)
+ {
+ SavedVelocity.Y = VelocityLimit;
+ }
+
+ if (SavedVelocity.Y < -VelocityLimit)
+ {
+ SavedVelocity.Y = -VelocityLimit;
+ }
+
+ Position.X = Position.X + SavedVelocity.X;
+ Position.Y = Position.Y + SavedVelocity.Y;